class ZMoveTo ( object ) :
    def __init__ ( self , sprite , pos , speed = 1 ) :
        super ( ZMoveTo , self ).__init__ ( )
        self.running = True
        self.sprite = sprite
        self.speed = speed
        self.pos = pos
        self.children = [ ]
        self.over = False

    def draw ( self ) :
        if self.running :
            self.moveTo ( )

    def update ( self , event , keys , m_keys , m_pos ) :
        pass

    def add ( self , transform ) :
        self.children.append ( transform )

    def move ( self , type ) :
        if type == "left" :
            self.sprite._pos = self.sprite._pos [ 0 ] - self.speed , self.sprite._pos [ 1 ]
        if type == "right" :
            self.sprite._pos = self.sprite._pos [ 0 ] + self.speed , self.sprite._pos [ 1 ]
        if type == "top" :
            self.sprite._pos = self.sprite._pos [ 0 ] , self.sprite._pos [ 1 ] - self.speed
        if type == "bottom" :
            self.sprite._pos = self.sprite._pos [ 0 ] , self.sprite._pos [ 1 ] + self.speed

    def moveTo ( self ) :
        s_pos = self.sprite._pos
        o_pos = self.pos
        if o_pos [ 0 ] > s_pos [ 0 ] :
            self.move ( "right" )
        if o_pos [ 0 ] < s_pos [ 0 ] :
            self.move ( "left" )
        if o_pos [ 1 ] > s_pos [ 1 ] :
            self.move ( "bottom" )
        if o_pos [ 1 ] < s_pos [ 1 ] :
            self.move ( "top" )
